package com.shop2cn.iapi.wxcomponent.parameter;

public enum AppStatusEnum {

    UNAUTHORIZED(0, "未授权"),

    AUTHORIZED(1, "已授权"),

    WEAPP_AUDIT_DURING(2,"审核中"),

    WEAPP_AUDIT_FAIL(3,"审核失败"),

    WEAPP_AUDIT_SUCCESS(4, "审核通过待发布"),

    ON_LINE(5, "已上线")

    ;


    private Integer code;
    private String message;

    AppStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }


    /**
     * 通过代值获取枚举项
     *
     * @param code
     * @return
     */
    public static AppStatusEnum getByCode(Integer code) {
        for (AppStatusEnum appStatusEnum : AppStatusEnum.values()) {
            if (appStatusEnum.getCode().equals(code)) {
                return appStatusEnum;
            }
        }
        return null;
    }
}
